      SUBROUTINE GINPUT(DEPEND)
C
C        'GINPUT' COMPUTES VARIABLES FROM INPUT FOR LATER USE
C
        IMPLICIT REAL*8 (A-H,O-Z)
C
      COMMON/CONSTS/ PI,TWOPI,RADIAN
C
      COMMON/IPOOL1/ IGRAV,IDAMP,IK,K1,ITIM,IAB,IAPS,IBB,IBPS,NK(10),
     .               LK(10),LLK(10)
C
      COMMON /IPRYRT/ IPRY
      COMMON/KNERGY/ S,OMC,BT
C
      COMMON/LIBDPR/ZK1D,ZK2D,PHIS,PHILD,DPHILD,BETLD,GAMLD,ZMDO,
     *              ZMDBO,CNV,DECAY
C
      COMMON/RPOOL1/ RHOK(10),TIME,SA(3,3),FM1(3,3),ZLK(10),OMEG(3),
     .               ZLKP(10),ZLKDP(10),CMAT(3,3),GBAR(3,3),YBCM(3),
     .               ZBZK(3,10),FCM(3,3),DTO,PHID,PHI
C
      COMMON/RPOOL6/ FM(3,3),CIY(3,3),CIZ(3,3),SAT(3,3),SZ1,SZ2,SZ3
C
      COMMON/VECTRS/ XSAT(3),XSATDT(3),AD(3)
C
      COMMON/XIN2  / ALFAE,BETAE,GAMAE,OMBC(3),ITEST2
C
C
      COMMON/PRYRAT/PRAT,RRAT,YRAT
C
      DIMENSION S(3,3),ST(3,3),BS(3,3),BT(3,3),OMC(3),SXOMC(3),
     .          DEPEND(150)
C
      RADIUS=0.D0
      DO 5 I=1,3
    5 RADIUS=RADIUS + XSAT(I)*XSAT(I)
      RADIUS=DSQRT(RADIUS)
C
      ALFAE=ALFAE*RADIAN
      BETAE=BETAE*RADIAN
      GAMAE=GAMAE*RADIAN
C
      SALFAE=DSIN(ALFAE)
      CALFAE=DCOS(ALFAE)
      SBETAE=DSIN(BETAE)
      CBETAE=DCOS(BETAE)
      SGAMAE=DSIN(GAMAE)
      CGAMAE=DCOS(GAMAE)
C
      ANG1=CBETAE*CGAMAE
      ANG2=CBETAE*SGAMAE
      ANG3=SBETAE*SGAMAE
      ANG4=SBETAE*CGAMAE
C
      S(1,1)= ANG1 + SALFAE*ANG3
      S(2,1)=-ANG2 + SALFAE*ANG4
      S(3,1)= CALFAE*SBETAE
C
      S(1,2)= CALFAE*SGAMAE
      S(2,2)= CALFAE*CGAMAE
      S(3,2)=-SALFAE
C
      S(1,3)=-ANG4 + SALFAE*ANG2
      S(2,3)= ANG3 + SALFAE*ANG1
      S(3,3)= CALFAE*CBETAE
C
      DO 10 I=1,3
      DO 10 J=1,3
   10 ST(I,J)=S(J,I)
C
      DO 20 I=1,3
   20 BS(3,I)=XSAT(I)/RADIUS
      YZ=XSAT(2)*XSATDT(3) - XSAT(3)*XSATDT(2)
      ZX=XSAT(3)*XSATDT(1) - XSAT(1)*XSATDT(3)
      XY=XSAT(1)*XSATDT(2) - XSAT(2)*XSATDT(1)
C
      RXVMAG=DSQRT(YZ*YZ + ZX*ZX + XY*XY)
C
      BS(2,1)=YZ/RXVMAG
      BS(2,2)=ZX/RXVMAG
      BS(2,3)=XY/RXVMAG
C
      BS(1,1)=BS(2,2)*BS(3,3)-BS(2,3)*BS(3,2)
      BS(1,2)=BS(2,3)*BS(3,1)-BS(2,1)*BS(3,3)
      BS(1,3)=BS(2,1)*BS(3,2)-BS(2,2)*BS(3,1)
C
      DO 30 I=1,3
      DO 30 J=1,3
   30 BT(I,J)=BS(J,I)
C
      CALL MATMPY(BT,ST,SA,3,3)
C
      DO 40 I=1,3
      DO 40 J=1,3
   40 SAT(I,J)=SA(J,I)
C
C
      OMC(1)=0.D0
      OMC(2)=RXVMAG/RADIUS**2
      DOTX=AD(1)*YZ
      DOTY=AD(2)*ZX
      DOTZ=AD(3)*XY
C
      OMC(3)=((DOTX + DOTY + DOTZ)*RADIUS)/RXVMAG**2
C
      DO 50 I=1,3
      SXOMC(I)=0.D0
      DO 50 J=1,3
   50 SXOMC(I)=SXOMC(I) + S(I,J)*OMC(J)
      IF(IPRY .EQ. 0) GO TO 60
      OMBC(1) = (CALFAE*SGAMAE*PRAT + CGAMAE*RRAT)/RADIAN
      OMBC(2) = (CALFAE*CGAMAE*PRAT - SGAMAE*RRAT)/RADIAN
      OMBC(3) = (-SALFAE*PRAT + YRAT)/RADIAN
   60 CONTINUE
C
      DO 70 I=1,3
   70 OMEG(I)=OMBC(I) + SXOMC(I)/RADIAN
C
      ALFAE=ALFAE/RADIAN
      BETAE=BETAE/RADIAN
      GAMAE=GAMAE/RADIAN
C
      L=0
      DO 80 I=1,2
      DO 80 J=1,3
      L=L + 1
   80 DEPEND(L)=SA(I,J)
C
      DO 90 I=1,3
      OMEG(I)=OMEG(I)*RADIAN
   90 DEPEND(I+6)=OMEG(I)
C
C
      IF(IDAMP.EQ.0) RETURN
      PHI=PHILD*RADIAN
      PHID=DPHILD*RADIAN
      DEPEND(10)=PHI
      DEPEND(11)=PHID
C
C
      RETURN
      END
